using System;

namespace SharpMud.MudLib.SAMPLE.Messaging.Act.BuiltIn.Movement.Directional
{
	public class Departure
	{
		public class ToWitness : IActMessage
		{
			#region Private Variables
			private Entities.ICharacter			_Actor;
			private Entities.ICharacter			_Witness;
			private Environment.ExitDirection	_DepartureDirection;
			#endregion
			
			#region Constructors
			private ToWitness()
			{}

			public ToWitness(Entities.ICharacter actor, Entities.ICharacter witness, Environment.ExitDirection departureDirection)
			{
				_Actor = actor;
				_Witness = witness;
				_DepartureDirection = departureDirection;
			}
			#endregion

			#region Public Properties
			public Entities.ICharacter Actor
			{
				get
				{
					return this._Actor;
				}
			}

			public Entities.ICharacter Witness
			{
				get
				{
					return this._Witness;
				}
			}

			public Environment.ExitDirection	DepartureDirection
			{
				get
				{
					return _DepartureDirection;
				}
			}
			#endregion
			
			#region IActMessage Members

			public IActMessageParameter[] Parameters
			{
				get
				{
					return new IActMessageParameter[] { 
														  new ActMessageParameter("Actor",this._Actor),
														  new ActMessageParameter("Witness",this._Witness),
														  new ActMessageParameter("DepartureDirection",this._DepartureDirection)
													  };	
				}
			}

			public string ToAbsoluteValue()
			{
				return String.Format("[white]{0}[green] leaves [white]{1}[green].",
					this._Actor.GetShortDescription(this._Witness),
					this._DepartureDirection.ToString() );
			}

			#endregion
		}


		public class ToActor : IActMessage
		{
			#region Private Variables
			private Entities.ICharacter			_Actor;
			private Environment.ExitDirection	_DepartureDirection;
			#endregion
			
			#region Constructors
			private ToActor()
			{}

			public ToActor(Entities.ICharacter actor, Environment.ExitDirection departureDirection)
			{
				_Actor = actor;
				_DepartureDirection = departureDirection;
			}
			#endregion

			#region Public Properties
			public Entities.ICharacter Actor
			{
				get
				{
					return this._Actor;
				}
			}

			public Environment.ExitDirection	DepartureDirection
			{
				get
				{
					return _DepartureDirection;
				}
			}
			#endregion
			
			#region IActMessage Members

			public IActMessageParameter[] Parameters
			{
				get
				{
					return new IActMessageParameter[] { 
														  new ActMessageParameter("Actor",this._Actor),
														  new ActMessageParameter("DepartureDirection",this._DepartureDirection)
													  };	
				}
			}

			public string ToAbsoluteValue()
			{
				return String.Format("[white]You[green] leave [white]{0}[green].",
					this._DepartureDirection.ToString() );
			}

			#endregion
		}
	}
}
